//
//  OnLineProductViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/5/13.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "OnLineProductViewController.h"
#import "AFNetworking.h"
#import "ProductPackageModel.h"
#import "SearchProductPackageModel.h"
#import "LeiListViewController.h"
#import "TieBaViewController.h"
#import "HotAndGreatViewController.h"
#import "OnLineProductModel.h"
#import "MyOrderViewController.h"
#import "MoreZiXunViewController.h"

#define kCurrentUserToken [[NSUserDefaults standardUserDefaults]objectForKey:@"token"]

@interface OnLineProductViewController ()<UIScrollViewDelegate>

@property (nonatomic, strong) UILabel *productPackageNameLabel; // 产品的名字

@property (nonatomic, strong) UIImageView *shoucangImageV; // 收藏的图标

@property (nonatomic, strong) UIScrollView *backGroundScrollV; // 背景

@property (nonatomic, strong) NSTimer *myTimer; // 检查请求是否超时
@property (nonatomic, assign) NSInteger numberOfTime; // 存储请求时间



@property (nonatomic, assign) CGFloat dongHuaStartWeiZhi; // 动画开始位置

// 下面是数据保存
@property (nonatomic, strong) NSMutableArray *targetPopulationImageArray; // 适用人群数组
@property (nonatomic, strong) NSMutableArray *leiShuZuArray; // 产品包中类数组
@property (nonatomic, strong) NSDictionary *onLineProductMessageDic; // 上线产品的信息字典

@property (nonatomic, assign) __block BOOL souCangIsClick; // 收藏按钮是否可以点击,默认为可以点击

@property (nonatomic, strong) NSMutableString *jianCeYiYiString; // 检测意义

@property (nonatomic, strong) NSMutableString *shiYongRenQun; // 适用人群


//梅江林
@property(nonatomic,copy)NSArray *goodsArray;
@end

@implementation OnLineProductViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    self.tabBarController.tabBar.hidden = YES;
    self.navigationController.navigationBar.hidden=NO;
    [self.navigationController.navigationBar setTranslucent:NO];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:YES];
    [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
    [self.myTimer invalidate];
    self.numberOfTime = 0;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    // navi的修改
    [self changeNavigation];
    // 布局
    [self addMySubview];
    // 检查网络进行数据请求
    [self checkNetAndRequestData];
   
    // 默认收藏按钮可以点击
    self.souCangIsClick = YES;
    
}

#pragma mark - 检查网络进行数据请求
- (void)checkNetAndRequestData
{
    if ([[[NetStatusHandle shareHandle] getNetStatus] isEqualToString:@"YES"]) {
        // 说明有网络
        [self addData];
        // 建立计数器，计算是否超时
        self.myTimer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(jiShiOnShangXianChanPin:) userInfo:nil repeats:YES];
         [[NSRunLoop currentRunLoop] addTimer:self.myTimer forMode:NSRunLoopCommonModes];
        self.numberOfTime = 0;
        // 开始动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] startAnimation];
    } else {
        NSLog(@"没有网络");
        // 添加提示框
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] addAlertTitle:@"通知" Content:kNoNetNoRefresh ToView:self];
    }
}

#pragma mark - 请求数据
- (void)addData
{
    NSString *urlString = [NSString stringWithFormat:@"http://120.26.129.84/api/production/newdetail/%@?token=%@", self.onLineProductID, kCurrentUserToken];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    [manager GET:urlString parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
        if (!responseObject) {
            return;
        }
        // 将计时器置为0
        self.numberOfTime = 0;
        [self.myTimer invalidate];
        // 结束动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
      //  NSLog(@"responseObject = %@", responseObject);
        // 产品包中类数组
        self.leiShuZuArray = [NSMutableArray array];
        NSArray *classificationsArray = [responseObject valueForKey:@"classifications"];
        for (NSDictionary *tempDic in classificationsArray) {
            SearchProductPackageModel *model = [[SearchProductPackageModel alloc] init];
            [model setValuesForKeysWithDictionary:tempDic];
            [self.leiShuZuArray addObject:model];
        }
        // 产品包的信息
        self.onLineProductMessageDic = [NSMutableDictionary dictionary];
        NSDictionary *productDic = [responseObject valueForKey:@"production"];
        [self.onLineProductMessageDic setValue:[productDic valueForKey:@"id"] forKey:@"id"]; // 产品id
        [self.onLineProductMessageDic setValue:[productDic valueForKey:@"name"] forKey:@"name"]; // 产品名字
        [self.onLineProductMessageDic setValue:[productDic valueForKey:@"description"] forKey:@"description"]; // 产品介绍
        [self.onLineProductMessageDic setValue:[productDic valueForKey:@"content_description"] forKey:@"content_description"]; // 产品内容介绍
        [self.onLineProductMessageDic setValue:[productDic valueForKey:@"target_population"] forKey:@"target_population"]; // 适用人群
        [self.onLineProductMessageDic setValue:[productDic valueForKey:@"sense"] forKey:@"sense"]; // 检测意义
        [self.onLineProductMessageDic setValue:[productDic valueForKey:@"is_collected"] forKey:@"is_collected"]; // 是否收藏
        [self.onLineProductMessageDic setValue:[productDic valueForKey:@"advertis_img_url"] forKey:@"advertis_img_url"]; // 宣传图片
        [self.onLineProductMessageDic setValue:[productDic valueForKey:@"content_img_url"] forKey:@"content_img_url"]; // 产品内容图片
        [self.onLineProductMessageDic setValue:[[productDic valueForKey:@"goods"][0] valueForKey:@"is_promotion"] forKey:@"is_promotion"]; // 是否促销
        [self.onLineProductMessageDic setValue:[[productDic valueForKey:@"goods"][0] valueForKey:@"promotion_price"] forKey:@"promotion_price"]; // 促销后价格
        [self.onLineProductMessageDic setValue:[[productDic valueForKey:@"goods"][0] valueForKey:@"price"] forKey:@"price"]; // 原价
        
        //商品信息
        _goodsArray=[NSArray arrayWithArray:productDic[@"goods"]];
        
        
        // 检测意义
        NSArray *senseArray = [productDic valueForKey:@"sense"];
        self.jianCeYiYiString = [NSMutableString stringWithFormat:@""];
        for (int i = 0; i < senseArray.count; i++) {
            NSString *tempString = senseArray[i];
            NSString *resultString = @"";
            if (i == (senseArray.count - 1)) {
                resultString = [NSString stringWithFormat:@"%d、%@", i + 1, tempString];
            } else {
                resultString = [NSString stringWithFormat:@"%d、%@\n", i + 1, tempString];
            }
            [self.jianCeYiYiString appendString:resultString];
        }
        
        // 适用人群
        NSArray *target_populationArray = [productDic valueForKey:@"target_population"];
        self.shiYongRenQun = [NSMutableString stringWithFormat:@""];
        for (int i = 0; i < target_populationArray.count; i++) {
            NSString *tempString = target_populationArray[i];
            NSString *resultString = @"";
            if (i == (target_populationArray.count - 1)) {
                resultString = [NSString stringWithFormat:@"%d、%@", i + 1, tempString];
            } else {
                resultString = [NSString stringWithFormat:@"%d、%@\n", i + 1, tempString];
            }
            [self.shiYongRenQun appendString:resultString];
        }
        
        // 适用人群图片
        self.targetPopulationImageArray = [NSMutableArray array];
        NSArray *target_population_img_urlArray = [productDic valueForKey:@"target_population_img_url"];
        for (NSString *imageUrl in target_population_img_urlArray) {
            [self.targetPopulationImageArray addObject:imageUrl];
        }
        
        
//        NSLog(@"self.onLineProductMessageDic =  %@", self.onLineProductMessageDic);
//        NSLog(@"self.leiShuZuArray = %@", self.leiShuZuArray);
        
        // 进行navigation的赋值
        self.productPackageNameLabel.text = [self.onLineProductMessageDic valueForKey:@"name"];
        // 是否收藏
        NSString *isCollect = [NSString stringWithFormat:@"%@", [self.onLineProductMessageDic valueForKey:@"is_collected"]];
        if ([isCollect isEqualToString:@"0"]) {
            // 说明未收藏
            self.shoucangImageV.image = [UIImage imageNamed:@"weishoucang-chanpin"];
        } else if ([isCollect isEqualToString:@"1"]) {
            // 说明收藏过了
            self.shoucangImageV.image = [UIImage imageNamed:@"suocangguo-chanpin"];
        }
        // 重新布局
        [self addMySubview];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"数据获取失败");
        // 关闭动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
        // 添加提示框
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] addAlertTitle:@"通知" Content:kHuoQuDataShiBaiNoRefresh ToView:self];
        // 暂停计时器
        [self.myTimer invalidate];
        self.numberOfTime = 0;
    }];
}

#pragma mark - 计时器方法
- (void)jiShiOnShangXianChanPin:(NSTimer *)timer
{
    self.numberOfTime++;
    NSLog(@"上线产品页时间= %ld", self.numberOfTime);
    if (self.numberOfTime > 10) {
        NSLog(@"上线产品页请求超时");
        self.numberOfTime = 0;
        [self.myTimer invalidate];
        // 关闭动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
        // 添加提示框
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] addAlertTitle:@"通知" Content:kQingQiuChaoShiNoReFresh ToView:self];
    }
}

// navi的修改
- (void)changeNavigation
{
    [self.navigationController.navigationBar setTranslucent:NO];
    
    // 左边
    UIImageView *leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    leftImageView.image = [UIImage imageNamed:@"houtui"];
    UITapGestureRecognizer *leftTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lastPage:)];
    [leftImageView addGestureRecognizer:leftTapGes];
    UIBarButtonItem *leftFirstItem = [[UIBarButtonItem alloc] initWithCustomView:leftImageView];
    
    self.productPackageNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
  //  self.productPackageNameLabel.text = @"名字";
    self.productPackageNameLabel.textColor = [UIColor whiteColor];
    self.productPackageNameLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    self.productPackageNameLabel.textAlignment = NSTextAlignmentLeft;
    UIBarButtonItem *leftSecondItem = [[UIBarButtonItem alloc] initWithCustomView:_productPackageNameLabel];
    self.navigationItem.leftBarButtonItems = @[leftFirstItem, leftSecondItem];
    
    
    
    //右边
//    UIImageView *fenxiangImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
//    fenxiangImageV.image = [UIImage imageNamed:@"fenxiang"];
//    UITapGestureRecognizer *fenxiangTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fenxiang:)];
//    [fenxiangImageV addGestureRecognizer:fenxiangTapGes];
//    UIBarButtonItem *rightFirstItem = [[UIBarButtonItem alloc] initWithCustomView:fenxiangImageV];
    
    self.shoucangImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
//    self.shoucangImageV.image = [UIImage imageNamed:@"weishoucang-chanpin"];
    UITapGestureRecognizer *shoucangTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(shoucang:)];
    [self.shoucangImageV addGestureRecognizer:shoucangTapGes];
    UIBarButtonItem *rightSecondItem = [[UIBarButtonItem alloc] initWithCustomView:_shoucangImageV];
    self.navigationItem.rightBarButtonItems = @[rightSecondItem];
    
    
}

#pragma mark - 返回
- (void)lastPage:(UITapGestureRecognizer *)tapGes
{
    [self.navigationController popViewControllerAnimated:YES];
}



#pragma mark - 布局
- (void)addMySubview
{
    self.backGroundScrollV = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    self.backGroundScrollV.backgroundColor = [UIColor whiteColor];
    self.backGroundScrollV.contentSize = CGSizeMake(kScreenWidth, 5 * kScreenHeight - 150 * kAdjustParamater);
    self.backGroundScrollV.delegate = self;
    self.backGroundScrollV.bounces = NO;
    [self.view addSubview:_backGroundScrollV];
    
#warning  产品简介
    // 产品简介图片
    UIImageView *chanPinJianJieImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinJianJieImageV.image = [UIImage imageNamed:@"newchanpinjianjie"];
    [self.backGroundScrollV addSubview:chanPinJianJieImageV];
    
    // 产品简介标题
    UILabel *chanPinJianJieTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinJianJieImageV.right + 10 * kAdjustParamater, 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
   // chanPinJianJieTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    chanPinJianJieTitleLabel.text = @"产品简介";
    chanPinJianJieTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    chanPinJianJieTitleLabel.textAlignment = NSTextAlignmentLeft;
    chanPinJianJieTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [self.backGroundScrollV addSubview:chanPinJianJieTitleLabel];
    
    // 产品简介下方灰色条
    UILabel *grayLineOnChanPinJianJie = [[UILabel alloc] initWithFrame:CGRectMake(0, chanPinJianJieImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnChanPinJianJie.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnChanPinJianJie];
    
    // 产品包图片
    UIImageView *productImageV = [[UIImageView alloc] initWithFrame:CGRectMake((375 - 307) / 2 * kAdjustParamater, grayLineOnChanPinJianJie.bottom + 15 * kAdjustParamater, 307 * kAdjustParamater, 202 * kAdjustParamater)];
    productImageV.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
   NSString *productImageUrl = [[self.onLineProductMessageDic valueForKey:@"advertis_img_url"] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    [productImageV sd_setImageWithURL:[NSURL URLWithString:productImageUrl] placeholderImage:[UIImage imageNamed:@""]];
    productImageV.layer.cornerRadius = 4 * kAdjustParamater;
    productImageV.layer.masksToBounds = YES;
    [self.backGroundScrollV addSubview:productImageV];
    
    // 是否促销
    NSString *ispromotion = [self.onLineProductMessageDic valueForKey:@"is_promotion"];
    // 原价
    UILabel *yuanJianLabel = [[UILabel alloc] initWithFrame:CGRectMake(67 * kAdjustParamater, productImageV.bottom + 20 * kAdjustParamater, 120 * kAdjustParamater, 15 * kAdjustParamater)];
//    yuanJianLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    if ([ispromotion isEqualToString:@"1"]) {
        yuanJianLabel.text = yuanJianLabel.text = [NSString stringWithFormat:@"￥%@", [self.onLineProductMessageDic valueForKey:@"price"]];
    } else if ([ispromotion isEqualToString:@"0"]) {
        yuanJianLabel.text = [NSString stringWithFormat:@"原价:   ￥%@", [self.onLineProductMessageDic valueForKey:@"price"]];
    }
    
    yuanJianLabel.textAlignment = NSTextAlignmentLeft;
    yuanJianLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    yuanJianLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k16Big];
    [self.backGroundScrollV addSubview:yuanJianLabel];
    
    
    
    // 原价上方的灰色条
    UILabel *grayLineOnYuanJianShangFang = [[UILabel alloc] initWithFrame:CGRectMake(yuanJianLabel.left - 15 * kAdjustParamater, yuanJianLabel.top + 7 * kAdjustParamater, 100 * kAdjustParamater, 1 * kAdjustParamater)];
    grayLineOnYuanJianShangFang.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    [self.backGroundScrollV addSubview:grayLineOnYuanJianShangFang];
    if ([ispromotion isEqualToString:@"1"]) {
        grayLineOnYuanJianShangFang.hidden = NO;
    } else {
        grayLineOnYuanJianShangFang.hidden = YES;
    }
    
    // 活动价前方的图片
    UIImageView *huoDongJianQianFangImageV = [[UIImageView alloc] initWithFrame:CGRectMake(190 * kAdjustParamater, yuanJianLabel.top, 15 * kAdjustParamater, 15 * kAdjustParamater)];
    huoDongJianQianFangImageV.image = [UIImage imageNamed:@""];
    [self.backGroundScrollV addSubview:huoDongJianQianFangImageV];
    
    // 活动价
    UILabel *huoDongJianLabel = [[UILabel alloc] initWithFrame:CGRectMake(productImageV.right - 33 * kAdjustParamater - 100 * kAdjustParamater , yuanJianLabel.top, 100 * kAdjustParamater, 15 * kAdjustParamater)];
  //  huoDongJianLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    
    huoDongJianLabel.textColor = [UIColor colorWithRed:226 / 255.0 green:61 / 255.0 blue:20 / 255.0 alpha:1];
    huoDongJianLabel.textAlignment = NSTextAlignmentRight;
    huoDongJianLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k16Big];
    if ([ispromotion isEqualToString:@"1"]) {
        huoDongJianLabel.hidden = NO;
        huoDongJianLabel.text = [NSString stringWithFormat:@"￥%@", [self.onLineProductMessageDic valueForKey:@"promotion_price"]];
    } else if ([ispromotion isEqualToString:@"0"]) {
        huoDongJianLabel.hidden = YES;
    }
    [self.backGroundScrollV addSubview:huoDongJianLabel];
    
    // 原价下方的灰色条
    UILabel *grayLineOnYuanJiaBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, yuanJianLabel.bottom + 10 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnYuanJiaBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnYuanJiaBottom];
    
    // 产品介绍
    UILabel *chanPinIntroduceLabel = [[UILabel alloc] initWithFrame:CGRectMake(20 * kAdjustParamater , grayLineOnYuanJiaBottom.bottom + 23 * kAdjustParamater, 345 * kAdjustParamater, 100 * kAdjustParamater)];
//    chanPinIntroduceLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
 //   chanPinIntroduceLabel.text = @"张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文";
    if ([[self.onLineProductMessageDic valueForKey:@"description"] length] == 0) {
        chanPinIntroduceLabel.text = @"";
    } else {
        chanPinIntroduceLabel.text = [self.onLineProductMessageDic valueForKey:@"description"];
    }
    chanPinIntroduceLabel.font = [UIFont fontWithName:@"ArialMT" size:k16Big];
    chanPinIntroduceLabel.numberOfLines = 0;
    // 自适应行间距
    [chanPinIntroduceLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:chanPinIntroduceLabel.text lineHeight:8]];
    [chanPinIntroduceLabel sizeToFit];
    
    [self.backGroundScrollV addSubview:chanPinIntroduceLabel];
    
    // 产品介绍下方的灰色条
    UILabel *grayLineOnChanPinIntroduceBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, chanPinIntroduceLabel.bottom + 25 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnChanPinIntroduceBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnChanPinIntroduceBottom];
    
    
#warning 产品内容
    
    // 产品内容图片
    UIImageView *chanPinNieRongImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnChanPinIntroduceBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinNieRongImageV.image = [UIImage imageNamed:@"newchanpinneirong"];
    [self.backGroundScrollV addSubview:chanPinNieRongImageV];
    
    // 产品内容标题
    UILabel *chanPinNeiRongTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinNieRongImageV.right + 10 * kAdjustParamater,grayLineOnChanPinIntroduceBottom.bottom + 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinNeiRongTitleLabel.text = @"产品内容";
    chanPinNeiRongTitleLabel.textAlignment = NSTextAlignmentLeft;
    chanPinNeiRongTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    chanPinNeiRongTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [self.backGroundScrollV addSubview:chanPinNeiRongTitleLabel];
    
    // 产品内容详情
    UILabel *chanPinNeiRongDetailLabel = [[UILabel alloc] initWithFrame:CGRectMake(305 * kAdjustParamater,  grayLineOnChanPinIntroduceBottom.bottom + 25 * kAdjustParamater, 35 * kAdjustParamater, 15 * kAdjustParamater)];
    chanPinNeiRongDetailLabel.userInteractionEnabled = YES;
    chanPinNeiRongDetailLabel.text = @"类别";
    chanPinNeiRongDetailLabel.textColor = kCyanColor;
    chanPinNeiRongDetailLabel.textAlignment = NSTextAlignmentCenter;
    chanPinNeiRongDetailLabel.font = [UIFont systemFontOfSize:k17Big];
    [self.backGroundScrollV addSubview:chanPinNeiRongDetailLabel];
    UITapGestureRecognizer *chanPinNeiRongDetailTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(chanPinNeiRongDetailGes:)];
    [chanPinNeiRongDetailLabel addGestureRecognizer:chanPinNeiRongDetailTapGes];
    
    // 产品内容详情图片
    UIImageView *chanPinNeiRongDetailImageV = [[UIImageView alloc] initWithFrame:CGRectMake(chanPinNeiRongDetailLabel.right + 6 * kAdjustParamater, grayLineOnChanPinIntroduceBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinNeiRongDetailImageV.image = [UIImage imageNamed:@"chanpinxiangqing"];
    [self.backGroundScrollV addSubview:chanPinNeiRongDetailImageV];
    chanPinNeiRongDetailImageV.userInteractionEnabled = YES;
    UITapGestureRecognizer *chanPinNeiRongDetailImageVTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(chanPinNeiRongDetailImageVGes:)];
    [chanPinNeiRongDetailImageV addGestureRecognizer:chanPinNeiRongDetailImageVTapGes];
    
    // 产品内容图片
    UIImageView *chanPinNieRongBigImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, chanPinNieRongImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 345 * kAdjustParamater)];
    chanPinNieRongBigImageV.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    NSString *chanPinNeiRongImageUrl = [[self.onLineProductMessageDic valueForKey:@"content_img_url"] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    [chanPinNieRongBigImageV sd_setImageWithURL:[NSURL URLWithString:chanPinNeiRongImageUrl] placeholderImage:[UIImage imageNamed:@""]];
    
  //  chanPinNieRongBigImageV.image = [UIImage imageNamed:@"chanpinneirong-online.jpg"];
    [self.backGroundScrollV addSubview:chanPinNieRongBigImageV];
    
    // 产品内容介绍
    UILabel *chanPinNeiRongIntroduceLabel = [[UILabel alloc] initWithFrame:CGRectMake(20 * kAdjustParamater, 23 * kAdjustParamater + chanPinNieRongBigImageV.bottom, 345 * kAdjustParamater, 50 * kAdjustParamater)];
  //  chanPinNeiRongIntroduceLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
  //  chanPinNeiRongIntroduceLabel.text = @"林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰林俊杰";
    if ([[self.onLineProductMessageDic valueForKey:@"content_description"] length] == 0) {
        chanPinNeiRongIntroduceLabel.text = @"";
    } else {
        chanPinNeiRongIntroduceLabel.text = [self.onLineProductMessageDic valueForKey:@"content_description"];
    }
    chanPinNeiRongIntroduceLabel.textColor = [UIColor blackColor];
    chanPinNeiRongIntroduceLabel.font = [UIFont systemFontOfSize:k16Big];
    chanPinNeiRongIntroduceLabel.numberOfLines = 0;
    [chanPinNeiRongIntroduceLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:chanPinNeiRongIntroduceLabel.text lineHeight:8]];
    [chanPinNeiRongIntroduceLabel sizeToFit];
    [self.backGroundScrollV addSubview:chanPinNeiRongIntroduceLabel];
    
    // 产品内容介绍下方的灰色条
    UILabel *grayLineOnChanPinNeiRongIntroduceBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, chanPinNeiRongIntroduceLabel.bottom + 25 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnChanPinNeiRongIntroduceBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnChanPinNeiRongIntroduceBottom];
    
    // 进行动画开始位置的赋值
    self.dongHuaStartWeiZhi = grayLineOnChanPinNeiRongIntroduceBottom.bottom;

#warning 检测意义
    
    // 检测意义图片
    UIImageView *jianCeYiYiImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnChanPinNeiRongIntroduceBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    jianCeYiYiImageV.image = [UIImage imageNamed:@"newjianceyiyi"];
    [self.backGroundScrollV addSubview:jianCeYiYiImageV];
    
    // 检测意义标题
    UILabel *jianCeYiYiTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinNieRongImageV.right + 10 * kAdjustParamater,grayLineOnChanPinNeiRongIntroduceBottom.bottom + 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    jianCeYiYiTitleLabel.text = @"检测意义";
    jianCeYiYiTitleLabel.textAlignment = NSTextAlignmentLeft;
    jianCeYiYiTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    jianCeYiYiTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [self.backGroundScrollV addSubview:jianCeYiYiTitleLabel];
    
    
    
    // 检测意义详情
    UILabel *jianCeYiYiTitleDetailLabel = [[UILabel alloc] initWithFrame:CGRectMake(305 * kAdjustParamater,  grayLineOnChanPinNeiRongIntroduceBottom.bottom + 25 * kAdjustParamater, 35 * kAdjustParamater, 15 * kAdjustParamater)];
    jianCeYiYiTitleDetailLabel.userInteractionEnabled = YES;
    jianCeYiYiTitleDetailLabel.text = @"详情";
    jianCeYiYiTitleDetailLabel.textColor = kCyanColor;
    jianCeYiYiTitleDetailLabel.textAlignment = NSTextAlignmentCenter;
    jianCeYiYiTitleDetailLabel.font = [UIFont systemFontOfSize:k17Big];
    [self.backGroundScrollV addSubview:jianCeYiYiTitleDetailLabel];
    UITapGestureRecognizer *jianCeYiYiTitleDetailLabelTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(jianCeYiYiTitleDetailLabelGes:)];
    [jianCeYiYiTitleDetailLabel addGestureRecognizer:jianCeYiYiTitleDetailLabelTapGes];
    
    // 检测意义详情图片
    UIImageView *jianCeYiYiTitleDetailImageV = [[UIImageView alloc] initWithFrame:CGRectMake(chanPinNeiRongDetailLabel.right + 6 * kAdjustParamater, grayLineOnChanPinNeiRongIntroduceBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    jianCeYiYiTitleDetailImageV.userInteractionEnabled = YES;
    jianCeYiYiTitleDetailImageV.image = [UIImage imageNamed:@"chanpinxiangqing"];
    [self.backGroundScrollV addSubview:jianCeYiYiTitleDetailImageV];
    UITapGestureRecognizer *jianCeYiYiTitleDetailImageVTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(jianCeYiYiTitleDetailImageVGes:)];
    [jianCeYiYiTitleDetailImageV addGestureRecognizer:jianCeYiYiTitleDetailImageVTapGes];

    // 检测意义图片下方的灰色条
    UILabel *grayLineOnJianCeYiYiImageVBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, jianCeYiYiImageV.bottom + 20 * kAdjustParamater, kScreenWidth,1.5 * kAdjustParamater)];
    grayLineOnJianCeYiYiImageVBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnJianCeYiYiImageVBottom];
    
    // 检测意义大图片
    UIImageView *jianCeYiYiBigImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, grayLineOnJianCeYiYiImageVBottom.bottom, kScreenWidth, 260 * kAdjustParamater)];
    jianCeYiYiBigImage.image = [UIImage imageNamed:@"jianceyiyi-online.jpg"];
    [self.backGroundScrollV addSubview:jianCeYiYiBigImage];
    
//    // 进行动画开始位置的赋值
//    self.dongHuaStartWeiZhi = grayLineOnJianCeYiYiImageVBottom.bottom;
    
    // 检测意义下方的灰色条
    UILabel *grayLineOnJianCeYiYiBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, grayLineOnChanPinNeiRongIntroduceBottom.bottom + 325 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnJianCeYiYiBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnJianCeYiYiBottom];
    
    
   
#warning 适用人群
    // 使用人群图片
    UIImageView *shiYongRenQunImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnJianCeYiYiBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    shiYongRenQunImageV.image = [UIImage imageNamed:@"newshiyongrenqun"];
    [self.backGroundScrollV addSubview:shiYongRenQunImageV];
    
    // 使用人群标题
    UILabel *shiYongRenQunTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(shiYongRenQunImageV.right + 10 * kAdjustParamater,grayLineOnJianCeYiYiBottom.bottom  + 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    // chanPinJianJieTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    shiYongRenQunTitleLabel.text = @"适用人群";
    shiYongRenQunTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    shiYongRenQunTitleLabel.textAlignment = NSTextAlignmentLeft;
    shiYongRenQunTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [self.backGroundScrollV addSubview:shiYongRenQunTitleLabel];
    
    // 使用人群下方灰色条
    UILabel *grayLineOnShiYongRenQunBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, shiYongRenQunImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnShiYongRenQunBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnShiYongRenQunBottom];
    
    // 适用人群图片
    
    UIImageView *shiYongRenQunImageVOne = [[UIImageView alloc] initWithFrame:CGRectMake(30 * kAdjustParamater, grayLineOnShiYongRenQunBottom.bottom + 25 * kAdjustParamater, 145 * kAdjustParamater, 127 * kAdjustParamater)];
    shiYongRenQunImageVOne.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    shiYongRenQunImageVOne.image = [UIImage imageNamed:@""];
    [self.backGroundScrollV addSubview:shiYongRenQunImageVOne];
    
    UIImageView *shiYongRenQunImageVTwo = [[UIImageView alloc] initWithFrame:CGRectMake(shiYongRenQunImageVOne.right + 25 * kAdjustParamater, grayLineOnShiYongRenQunBottom.bottom + 25 * kAdjustParamater, 145 * kAdjustParamater, 127 * kAdjustParamater)];
    shiYongRenQunImageVTwo.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    shiYongRenQunImageVTwo.image = [UIImage imageNamed:@""];
    [self.backGroundScrollV addSubview:shiYongRenQunImageVTwo];
    // 图片显示的判断
    if (self.targetPopulationImageArray.count == 0) {
        shiYongRenQunImageVOne.hidden = YES;
        shiYongRenQunImageVTwo.hidden = YES;
    } else if (self.targetPopulationImageArray.count == 1) {
        NSString *image1Url = [self.targetPopulationImageArray[0] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        [shiYongRenQunImageVOne sd_setImageWithURL:[NSURL URLWithString:image1Url] placeholderImage:[UIImage imageNamed:@""]];
        shiYongRenQunImageVTwo.hidden = YES;
    } else if (self.targetPopulationImageArray.count == 2) {
        NSString *image1Url = [self.targetPopulationImageArray[0] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSString *image2Url = [self.targetPopulationImageArray[1] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        [shiYongRenQunImageVOne sd_setImageWithURL:[NSURL URLWithString:image1Url] placeholderImage:[UIImage imageNamed:@""]];
        [shiYongRenQunImageVTwo sd_setImageWithURL:[NSURL URLWithString:image2Url] placeholderImage:[UIImage imageNamed:@""]];
    }

    // 适用人群内容
    UILabel *shiYongRenQunLabel = [[UILabel alloc] initWithFrame: CGRectMake(25 * kAdjustParamater, shiYongRenQunImageVOne.bottom + 28 * kAdjustParamater, 335 * kAdjustParamater, 20 * kAdjustParamater)];
    // shiYongRenQunLabel.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
   // shiYongRenQunLabel.text = @"1、久坐办公室,缺乏运动,经常熬夜的亚健康人群;\n\n2、具有高血压家族史的人群;\n\n3、患有“三高“等心肌梗死易感致病因素人群;\n\n4、具有较强健康管意识的人群;";
    if (self.shiYongRenQun.length== 0) {
        shiYongRenQunLabel.text = @"";
    } else {
        shiYongRenQunLabel.text = self.shiYongRenQun;
    }
    shiYongRenQunLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.8];
    shiYongRenQunLabel.numberOfLines = 0;
    shiYongRenQunLabel.font = [UIFont systemFontOfSize:k16Big];
    // 设置行间距
    [shiYongRenQunLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:shiYongRenQunLabel.text lineHeight:10]];
    [shiYongRenQunLabel sizeToFit];
    [self.backGroundScrollV addSubview:shiYongRenQunLabel];
//    // 自适应高度
//    CGRect shiyongRenQunNewFrame = shiYongRenQunLabel.frame;
//    shiyongRenQunNewFrame.size.height = [[NetStatusHandle shareHandle] adjustHeight:shiYongRenQunLabel.text size:17 width:335];
//    shiYongRenQunLabel.frame = shiyongRenQunNewFrame;
    
    // 使用人群人群底部灰色条
    UILabel *grayLineOnShiYongRenQunLabelBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, shiYongRenQunLabel.bottom + 25 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnShiYongRenQunLabelBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnShiYongRenQunLabelBottom];

#warning 产品优势
    
    // 使用人群图片
    UIImageView *chanPinYouShiImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnShiYongRenQunLabelBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinYouShiImageV.image = [UIImage imageNamed:@"newchanpinyoushi"];
    [self.backGroundScrollV addSubview:chanPinYouShiImageV];
    
    // 使用人群标题
    UILabel *chanPinYouShiTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinYouShiImageV.right + 10 * kAdjustParamater,grayLineOnShiYongRenQunLabelBottom.bottom  + 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    // chanPinJianJieTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    chanPinYouShiTitleLabel.text = @"品牌优势";
    chanPinYouShiTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    chanPinYouShiTitleLabel.textAlignment = NSTextAlignmentLeft;
    chanPinYouShiTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [self.backGroundScrollV addSubview:chanPinYouShiTitleLabel];
    
    // 使用人群下方灰色条
    UILabel *grayLineOnChanPinYouShiBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, chanPinYouShiImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnChanPinYouShiBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnChanPinYouShiBottom];
    
    // 产品优势大图
    UIImageView *chanPinTeSeBigImageV = [[UIImageView alloc] initWithFrame:CGRectMake(47 * kAdjustParamater, grayLineOnChanPinYouShiBottom.bottom + 30 * kAdjustParamater, 280 * kAdjustParamater, 237 * kAdjustParamater)];
    chanPinTeSeBigImageV.image = [UIImage imageNamed:@"chanpinyoushi-online.jpg"];
    // chanPinTeSeBigImageV.backgroundColor = [UIColor redColor];
    [self.backGroundScrollV addSubview:chanPinTeSeBigImageV];
    
    // 产品优势简介的背景白色图
    UIView *whiteBackGroundViewOnChanPinTese = [[UIView alloc] initWithFrame:CGRectMake(20 * kAdjustParamater, chanPinTeSeBigImageV.bottom + 45 * kAdjustParamater, 334 * kAdjustParamater, 274 * kAdjustParamater)];
    whiteBackGroundViewOnChanPinTese.backgroundColor = [UIColor whiteColor];
    whiteBackGroundViewOnChanPinTese.layer.borderColor = [[[UIColor blackColor] colorWithAlphaComponent:0.2] CGColor];
    whiteBackGroundViewOnChanPinTese.layer.borderWidth = 3 * kAdjustParamater;
    whiteBackGroundViewOnChanPinTese.layer.cornerRadius = 5 * kAdjustParamater;
    [self.backGroundScrollV addSubview:whiteBackGroundViewOnChanPinTese];
    
    // 产品优势简介
    UILabel *chanPinTeSeJieShaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 10 * kAdjustParamater, whiteBackGroundViewOnChanPinTese.width - 15 * kAdjustParamater, whiteBackGroundViewOnChanPinTese.height - 20 * kAdjustParamater)];
    
    chanPinTeSeJieShaoLabel.text = @"性价比高：产品拥有让人羡慕的性价比\n检测专业：公司团队拥有专业的基因测序和\n\t\t信息分析团队\n位点精确：检测位点拥有最为苛刻的挑选标\n\t\t准\n矫正系统：风险评估拥有自主研发的其他致\n\t\t病因素纠正系统\n社交属性：用户检测后拥有一套属于你的个\n\t\t性标签和基因关系";
    chanPinTeSeJieShaoLabel.numberOfLines = 0;
    chanPinTeSeJieShaoLabel.textColor = [UIColor blackColor];
    chanPinTeSeJieShaoLabel.font = [UIFont systemFontOfSize:k16Big];
    [chanPinTeSeJieShaoLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:chanPinTeSeJieShaoLabel.text lineHeight:8]];
    [whiteBackGroundViewOnChanPinTese addSubview:chanPinTeSeJieShaoLabel];
    
    // 产品优势底部灰色条
    UILabel *grayLineOnChanPinTeSeBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, whiteBackGroundViewOnChanPinTese.bottom + 40 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnChanPinTeSeBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnChanPinTeSeBottom];
    
#warning 产品流程
    
    // 产品流程图片
    UIImageView *chanPinLiuChengImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnChanPinTeSeBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinLiuChengImageV.image = [UIImage imageNamed:@"chanpinliucheng"];
    [self.backGroundScrollV addSubview:chanPinLiuChengImageV];
    
    // 产品流程标题
    UILabel *chanPinLiuChengTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinLiuChengImageV.right + 10 * kAdjustParamater,grayLineOnChanPinTeSeBottom.bottom  + 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    // chanPinJianJieTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    chanPinLiuChengTitleLabel.text = @"购买流程";
    chanPinLiuChengTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    chanPinLiuChengTitleLabel.textAlignment = NSTextAlignmentLeft;
    chanPinLiuChengTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [self.backGroundScrollV addSubview:chanPinLiuChengTitleLabel];
    
    // 产品流程下方灰色条
    UILabel *grayLineOnChanPinLiuChengImageBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, chanPinLiuChengImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnChanPinLiuChengImageBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnChanPinLiuChengImageBottom];
    
    // 下订单购买图片
    UIImageView *xiaDingDanGouMaiImageV = [[UIImageView alloc] initWithFrame:CGRectMake(27 * kAdjustParamater, grayLineOnChanPinLiuChengImageBottom.bottom  + 40 * kAdjustParamater, 48 * kAdjustParamater, 48 * kAdjustParamater)];
    //  xiaDingDanGouMaiImageV.backgroundColor = [UIColor redColor];
    xiaDingDanGouMaiImageV.image = [UIImage imageNamed:@"xiadingdan-chanpin"];
    [self.backGroundScrollV addSubview:xiaDingDanGouMaiImageV];
    
    UILabel *xiaDingDanGouMaiLabel = [[UILabel alloc] initWithFrame:CGRectMake(xiaDingDanGouMaiImageV.left -5 * kAdjustParamater, xiaDingDanGouMaiImageV.bottom + 23 * kAdjustParamater, 58 * kAdjustParamater, 15 * kAdjustParamater)];
    //  xiaDingDanGouMaiLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    xiaDingDanGouMaiLabel.text = @"下单购买";
    xiaDingDanGouMaiLabel.textColor = kCyanColor;
    xiaDingDanGouMaiLabel.textAlignment = NSTextAlignmentCenter;
    xiaDingDanGouMaiLabel.font = [UIFont systemFontOfSize:k14Big];
    [self.backGroundScrollV addSubview:xiaDingDanGouMaiLabel];
    
    // 下单购买右面的箭头
    UIImageView *xiaDanGouMaiRightJianTou = [[UIImageView alloc] initWithFrame:CGRectMake(xiaDingDanGouMaiImageV.right + 15 * kAdjustParamater, xiaDingDanGouMaiImageV.top + 15 * kAdjustParamater, 25 * kAdjustParamater, 15 * kAdjustParamater)];
    xiaDanGouMaiRightJianTou.image = [UIImage imageNamed:@"jiansejiantou-chanpin"];
    //   xiaDanGouMaiRightJianTou.backgroundColor = [UIColor redColor];
    [self.backGroundScrollV addSubview:xiaDanGouMaiRightJianTou];
    
    // 样本采集
    UIImageView *yangBenCaiJiImageV = [[UIImageView alloc] initWithFrame:CGRectMake(xiaDanGouMaiRightJianTou.right + 3 * kAdjustParamater, xiaDingDanGouMaiImageV.top, 48 * kAdjustParamater, 48 * kAdjustParamater)];
    yangBenCaiJiImageV.image = [UIImage imageNamed:@"yangpincaiji-chanpin"];
    [self.backGroundScrollV addSubview:yangBenCaiJiImageV];
    
    // 样本采集文本
    UILabel *yangBenCaiJiLabel = [[UILabel alloc] initWithFrame:CGRectMake(yangBenCaiJiImageV.left - 5 * kAdjustParamater, xiaDingDanGouMaiLabel.top, 58 * kAdjustParamater, 15 * kAdjustParamater)];
    yangBenCaiJiLabel.text = @"样本采集";
    yangBenCaiJiLabel.font = [UIFont systemFontOfSize:k14Big];
    yangBenCaiJiLabel.textColor = kCyanColor;
    yangBenCaiJiLabel.textAlignment = NSTextAlignmentCenter;
    [self.backGroundScrollV addSubview:yangBenCaiJiLabel];
    
    // 样本采集右边的箭头
    
    UIImageView *yangBenCaiJiRightJianTou = [[UIImageView alloc] initWithFrame:CGRectMake(yangBenCaiJiImageV.right + 3 * kAdjustParamater, xiaDanGouMaiRightJianTou.top, 25 * kAdjustParamater, 15 * kAdjustParamater)];
    yangBenCaiJiRightJianTou.image = [UIImage imageNamed:@"jiansejiantou-chanpin"];
    [self.backGroundScrollV addSubview:yangBenCaiJiRightJianTou];
    
    // 基因检测
    UIImageView *jiYiJianCeImageV = [[UIImageView alloc] initWithFrame:CGRectMake(yangBenCaiJiRightJianTou.right + 15 * kAdjustParamater, xiaDingDanGouMaiImageV.top, 48 * kAdjustParamater, 48 * kAdjustParamater)];
    jiYiJianCeImageV.image = [UIImage imageNamed:@"jiyinjiance-chanpin"];
    [self.backGroundScrollV addSubview:jiYiJianCeImageV];
    
    // 基因检测文本
    UILabel *jiYiJianCeLabel = [[UILabel alloc] initWithFrame:CGRectMake(jiYiJianCeImageV.left - 5 * kAdjustParamater, xiaDingDanGouMaiLabel.top, 58 * kAdjustParamater, 15 * kAdjustParamater)];
    jiYiJianCeLabel.text = @"基因检测";
    jiYiJianCeLabel.textColor = kCyanColor;
    jiYiJianCeLabel.font = [UIFont systemFontOfSize:k14Big];
    jiYiJianCeLabel.textAlignment = NSTextAlignmentCenter;
    [self.backGroundScrollV addSubview:jiYiJianCeLabel];
    
    // 基因检测右边的箭头
    UIImageView *jiYiJianCeRightJianTou = [[UIImageView alloc] initWithFrame:CGRectMake(jiYiJianCeImageV.right + 15 * kAdjustParamater, xiaDanGouMaiRightJianTou.top, 25 * kAdjustParamater, 15 * kAdjustParamater)];
    jiYiJianCeRightJianTou.image = [UIImage imageNamed:@"jiansejiantou-chanpin"];
    [self.backGroundScrollV addSubview:jiYiJianCeRightJianTou];
    
    // 查看报告
    UIImageView *chaKanBaoGaoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(jiYiJianCeRightJianTou.right + 7 * kAdjustParamater, xiaDingDanGouMaiImageV.top, 48 * kAdjustParamater, 48 * kAdjustParamater)];
    chaKanBaoGaoImageV.image = [UIImage imageNamed:@"chakanbaogao"];
    [self.backGroundScrollV addSubview:chaKanBaoGaoImageV];
    
    // 查看报告文本
    UILabel *chaKanBaoGaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(chaKanBaoGaoImageV.left - 5 * kAdjustParamater, xiaDingDanGouMaiLabel.top, 58 * kAdjustParamater, 15 * kAdjustParamater)];
    chaKanBaoGaoLabel.text = @"查看报告";
    chaKanBaoGaoLabel.textColor = kCyanColor;
    chaKanBaoGaoLabel.font = [UIFont systemFontOfSize:k14Big];
    chaKanBaoGaoLabel.textAlignment = NSTextAlignmentCenter;
    [self.backGroundScrollV addSubview:chaKanBaoGaoLabel];
    
    
    // 产品流程下方的灰色条
    UILabel *grayLineOnChanPinLiuChengBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, xiaDingDanGouMaiLabel.bottom + 45 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnChanPinLiuChengBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnChanPinLiuChengBottom];

#warning 产品评价
    // 产品评价图片
    UIImageView *chanPinPingJiaImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnChanPinLiuChengBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinPingJiaImageV.image = [UIImage imageNamed:@"chanpinpingjia"];
    [self.backGroundScrollV addSubview:chanPinPingJiaImageV];
    
    // 产品评价标题
    UILabel *chanPinPingJiaTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinPingJiaImageV.right + 10 * kAdjustParamater,grayLineOnChanPinLiuChengBottom.bottom  + 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    // chanPinJianJieTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    chanPinPingJiaTitleLabel.text = @"产品评价";
    chanPinPingJiaTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    chanPinPingJiaTitleLabel.textAlignment = NSTextAlignmentLeft;
    chanPinPingJiaTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [self.backGroundScrollV addSubview:chanPinPingJiaTitleLabel];
    
    // 产品评价下方灰色条
    UILabel *grayLineOnChanPinPingJiaImageBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, chanPinPingJiaImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnChanPinPingJiaImageBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnChanPinPingJiaImageBottom];
    
    // 没有相关评论
    UILabel *noXiangGuanPingLunLabel = [[UILabel alloc] initWithFrame:CGRectMake((375 - 150) / 2 * kAdjustParamater, grayLineOnChanPinPingJiaImageBottom.bottom + 50 * kAdjustParamater, 150 * kAdjustParamater, 15 * kAdjustParamater)];
    noXiangGuanPingLunLabel.text = @"暂时没有相关评价";
    noXiangGuanPingLunLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    noXiangGuanPingLunLabel.textAlignment = NSTextAlignmentCenter;
    noXiangGuanPingLunLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [self.backGroundScrollV addSubview:noXiangGuanPingLunLabel];
    
    // 产品评价下方的灰色条
    UILabel *grayLineOnChanPinPingJiaBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, noXiangGuanPingLunLabel.bottom + 40 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnChanPinPingJiaBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnChanPinPingJiaBottom];

#warning 相关链接
    // 相关链接图片
    UIImageView *xiangGuanLianJieImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnChanPinPingJiaBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    xiangGuanLianJieImageV.image = [UIImage imageNamed:@"xiangguanlianjie"];
    [self.backGroundScrollV addSubview:xiangGuanLianJieImageV];
    
    // 相关链接标题
    UILabel *xiangGuanLianJieTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(xiangGuanLianJieImageV.right + 10 * kAdjustParamater,grayLineOnChanPinPingJiaBottom.bottom  + 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    // chanPinJianJieTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    xiangGuanLianJieTitleLabel.text = @"相关链接";
    xiangGuanLianJieTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    xiangGuanLianJieTitleLabel.textAlignment = NSTextAlignmentLeft;
    xiangGuanLianJieTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [self.backGroundScrollV addSubview:xiangGuanLianJieTitleLabel];
    
    // 相关链接下方灰色条
    UILabel *grayLineOnXiangGuanLianJieImageBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, xiangGuanLianJieImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1 * kAdjustParamater)];
    grayLineOnXiangGuanLianJieImageBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [self.backGroundScrollV addSubview:grayLineOnXiangGuanLianJieImageBottom];
    
    // 相关链接咨询
    UIButton *xiangGuanZiXunButton = [UIButton buttonWithType:UIButtonTypeSystem];
    xiangGuanZiXunButton.frame = CGRectMake(0, grayLineOnXiangGuanLianJieImageBottom.bottom, kScreenWidth / 2, 47 * kAdjustParamater);
    xiangGuanZiXunButton.backgroundColor = [UIColor whiteColor];
    [xiangGuanZiXunButton setTitle:@"#相关咨询#" forState:UIControlStateNormal];
    [xiangGuanZiXunButton setTitleColor:[[UIColor blackColor]colorWithAlphaComponent:0.5] forState:UIControlStateNormal];
    xiangGuanZiXunButton.titleLabel.font = [UIFont systemFontOfSize:k18Big];
    [xiangGuanZiXunButton addTarget:self action:@selector(xiangGuanZiXun:) forControlEvents:UIControlEventTouchUpInside];
    [self.backGroundScrollV addSubview:xiangGuanZiXunButton];
    
    // 相关帖子
    UIButton *xiangGuanTieZiButton = [UIButton buttonWithType:UIButtonTypeSystem];
    xiangGuanTieZiButton.frame = CGRectMake(xiangGuanZiXunButton.right + 1 * kAdjustParamater, xiangGuanZiXunButton.top, kScreenWidth / 2, 47 * kAdjustParamater);
    xiangGuanTieZiButton.backgroundColor = [UIColor whiteColor];
    [xiangGuanTieZiButton setTitle:@"#相关帖子#" forState:UIControlStateNormal];
    [xiangGuanTieZiButton setTitleColor:[[UIColor blackColor] colorWithAlphaComponent:0.5]  forState:UIControlStateNormal];
    xiangGuanTieZiButton.titleLabel.font = [UIFont systemFontOfSize:k18Big];
    [xiangGuanTieZiButton addTarget:self action:@selector(xiangGuanTieZi:) forControlEvents:UIControlEventTouchUpInside];
    [self.backGroundScrollV addSubview:xiangGuanTieZiButton];
    
    // 竖着的灰色条
    UILabel *grayLineShuZhe = [[UILabel alloc] initWithFrame:CGRectMake(165 * kAdjustParamater, grayLineOnXiangGuanLianJieImageBottom.bottom + 23 * kAdjustParamater, 47 * kAdjustParamater, 1 * kAdjustParamater)];
    grayLineShuZhe.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    grayLineShuZhe.transform = CGAffineTransformMakeRotation(M_PI / 2);
    [self.backGroundScrollV addSubview:grayLineShuZhe];
    
    // 改变background的高度
    self.backGroundScrollV.contentSize = CGSizeMake(kScreenWidth, xiangGuanTieZiButton.bottom + 200 * kAdjustParamater);
    
    // 相关咨询下方的灰色条
    UILabel *grayLineOnXiangGuanZiXunBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, xiangGuanZiXunButton.bottom, kScreenWidth, 1 * kAdjustParamater)];
    grayLineOnXiangGuanZiXunBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [self.backGroundScrollV addSubview:grayLineOnXiangGuanZiXunBottom];
    
    
#warning 下方的加入订单和立即购买
//    // 加入订单
//    UIButton *joinDingDan = [UIButton buttonWithType:UIButtonTypeSystem];
//    joinDingDan.frame = CGRectMake(0, kScreenHeight - 64 - 57 * kAdjustParamater, kScreenWidth / 2, 57 * kAdjustParamater);
//    joinDingDan.backgroundColor = kCyanColor;
//    [joinDingDan setTitle:@"加入订单" forState:UIControlStateNormal];
//    [joinDingDan setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    joinDingDan.titleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
//    [joinDingDan addTarget:self action:@selector(joinDingDan:) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:joinDingDan];
    
    // 立即购买
    
    UIButton *liJiGouMai = [UIButton buttonWithType:UIButtonTypeSystem];
    liJiGouMai.frame = CGRectMake(0, kScreenHeight - 64 - 57 * kAdjustParamater, kScreenWidth , 57 * kAdjustParamater);
    liJiGouMai.backgroundColor = [UIColor colorWithRed:43 / 255.0 green:142 / 255.0 blue:164 / 255.0 alpha:1];
    if ([[self.onLineProductMessageDic valueForKey:@"is_promotion"] isEqualToString:@"1"]) {
        // 说明促销
        NSString *cuXiaoJia = [self.onLineProductMessageDic valueForKey:@"promotion_price"];
        [liJiGouMai setTitle:[NSString stringWithFormat:@"￥ %@立即购买%@套餐", cuXiaoJia, self.onLineProductName] forState:UIControlStateNormal];
    } else if ([[self.onLineProductMessageDic valueForKey:@"is_promotion"] isEqualToString:@"0"]) {
        // 说明不促销
        NSString *yuanJia = [self.onLineProductMessageDic valueForKey:@"price"];
        [liJiGouMai setTitle:[NSString stringWithFormat:@"￥ %@立即购买%@套餐", yuanJia, self.onLineProductName] forState:UIControlStateNormal];
    }
    
    [liJiGouMai setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    liJiGouMai.titleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    [liJiGouMai addTarget:self action:@selector(liJiGouMai:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:liJiGouMai];
    
}

#pragma mark - 创建检测详情动画
- (void)createJianCeDetailAnimationJianCeNeiRongBottom:(CGFloat)bottomOne  shouldHeight:(CGFloat)height
{
    // 添加灰色背景
    UIView *grayBackGroundOnJianCeYiYi = [[UIView alloc] initWithFrame:CGRectMake(0, bottomOne, kScreenWidth, height)];
    grayBackGroundOnJianCeYiYi.userInteractionEnabled = YES;
    grayBackGroundOnJianCeYiYi.backgroundColor = [UIColor clearColor];
    [self.backGroundScrollV addSubview:grayBackGroundOnJianCeYiYi];
    // 添加手势
    UITapGestureRecognizer *grayBackGroundTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissGrayViewGes1:)];
    [grayBackGroundOnJianCeYiYi addGestureRecognizer:grayBackGroundTapGes];
    
    
    // 详情
    UILabel *xiangQingLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 70 * kAdjustParamater, 25 * kAdjustParamater, 35 * kAdjustParamater, 15 * kAdjustParamater)];
    xiangQingLabel.text = @"详情";
    xiangQingLabel.textColor = [UIColor clearColor];
    xiangQingLabel.textAlignment = NSTextAlignmentCenter;
    xiangQingLabel.font = [UIFont systemFontOfSize:k17Big];
    [grayBackGroundOnJianCeYiYi addSubview:xiangQingLabel];
    
    // 白色框
    UIImageView *whiteKuangImageV = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 205 * kAdjustParamater, xiangQingLabel.bottom + 3 * kAdjustParamater, 195 * kAdjustParamater, 0)];
    whiteKuangImageV.image =[UIImage imageNamed:@"chanpinkuang-chanpin"];
    [grayBackGroundOnJianCeYiYi addSubview:whiteKuangImageV];
    
    // 添加文本
    UILabel *JianCeYiYiContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(20 * kAdjustParamater, 30 * kAdjustParamater, whiteKuangImageV.width - 30  * kAdjustParamater, 0 * kAdjustParamater)];
    //  JianCeYiYiContentLabel.backgroundColor = [UIColor redColor];
 //   JianCeYiYiContentLabel.text = @"1、及时准确的了解自己\n\t遗传背景信息\n2、尽早预测自身心脑血\n\t管疾病的发生风险\n3、有针对性的定制相同\n\t的健康管理意识较\n\t强的中老年人";
    if (self.jianCeYiYiString.length == 0) {
        JianCeYiYiContentLabel.text = @"";
    } else {
        JianCeYiYiContentLabel.text = self.jianCeYiYiString;
    }
    JianCeYiYiContentLabel.textColor = [UIColor whiteColor];
    JianCeYiYiContentLabel.numberOfLines = 0;
    JianCeYiYiContentLabel.font = [UIFont systemFontOfSize:k15Big];
    // 进行行间距的调整
    [JianCeYiYiContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:JianCeYiYiContentLabel.text lineHeight:8]];
    
    
    [whiteKuangImageV addSubview:JianCeYiYiContentLabel];
    
    // 动画
    [UIView animateWithDuration:0.5 animations:^{
        grayBackGroundOnJianCeYiYi.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
        xiangQingLabel.textColor = [UIColor whiteColor];
        whiteKuangImageV.frame = CGRectMake(whiteKuangImageV.frame.origin.x, whiteKuangImageV.frame.origin.y, 195 * kAdjustParamater, 230 * kAdjustParamater);
        [JianCeYiYiContentLabel sizeToFit];
        // JianCeYiYiContentLabel.frame = CGRectMake(JianCeYiYiContentLabel.frame.origin.x, JianCeYiYiContentLabel.frame.origin.y, JianCeYiYiContentLabel.frame.size.width, JianCeYiYiContentLabel.frame.size.height);
    } completion:^(BOOL finished) {
        
    }];
    
    
}

#pragma mark - 动画取消
- (void)dismissGrayViewGes1:(UITapGestureRecognizer *)tapGes
{
    [tapGes.view removeFromSuperview];
}

#pragma mark - 产品内容详情
- (void)chanPinNeiRongDetailGes:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"产品内容详情label");
    LeiListViewController *leiListVC = [[LeiListViewController alloc] init];
    leiListVC.leiListArray = self.leiShuZuArray;
    [self.navigationController pushViewController:leiListVC animated:YES];
}

- (void)chanPinNeiRongDetailImageVGes:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"产品内容详情image");
    LeiListViewController *leiListVC = [[LeiListViewController alloc] init];
    leiListVC.leiListArray = self.leiShuZuArray;
    [self.navigationController pushViewController:leiListVC animated:YES];
    
}

#pragma mark - 检测意义
- (void)jianCeYiYiTitleDetailLabelGes:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"检测意义label");
    [self createJianCeDetailAnimationJianCeNeiRongBottom:self.dongHuaStartWeiZhi shouldHeight:325 * kAdjustParamater];
}

- (void)jianCeYiYiTitleDetailImageVGes:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"检测意义image");
    [self createJianCeDetailAnimationJianCeNeiRongBottom:self.dongHuaStartWeiZhi shouldHeight:325 * kAdjustParamater];
}

#pragma mark - 相关资讯
- (void)xiangGuanZiXun:(UIButton *)button
{
    NSLog(@"相关资讯");
    MoreZiXunViewController *moreZiXunVC = [[MoreZiXunViewController alloc] init];
    [self.navigationController pushViewController:moreZiXunVC animated:YES];
}

#pragma mark - 相关帖子
- (void)xiangGuanTieZi:(UIButton *)button
{
    HotAndGreatViewController *vc=[[HotAndGreatViewController alloc]init];
    vc.myTitle=@"热门帖子";
    vc.selectedIndex=2;
    vc.translucentState=YES;
    [self.navigationController pushViewController:vc animated:YES];
    NSLog(@"相关帖子");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - 加入订单
- (void)joinDingDan:(UIButton *)button
{
    NSLog(@"加入订单");
}

#pragma mark - 立即购买
- (void)liJiGouMai:(UIButton *)button
{
    NSLog(@"立即购买");
    OnLineProductModel *model=[[OnLineProductModel alloc]init];
    model.myID=[NSString stringWithFormat:@"%@",self.onLineProductMessageDic[@"id"]];
    model.name=[NSString stringWithFormat:@"%@",self.onLineProductMessageDic[@"name"]];
    model.description1=[NSString stringWithFormat:@"%@",self.onLineProductMessageDic[@"description"]];
    model.short_description_title=[NSString stringWithFormat:@"%@",self.onLineProductMessageDic[@"short_discription"]];
    model.advertis_img_url=[NSString stringWithFormat:@"%@",self.onLineProductMessageDic[@"advertis_img_url"]];
    model.price=[NSString stringWithFormat:@"%@",_goodsArray[0][@"price"]];
    model.promotion_price=[NSString stringWithFormat:@"%@",_goodsArray[0][@"promotion_price"]];
    model.is_promotion=[NSString stringWithFormat:@"%@",_goodsArray[0][@"is_promotion"]];
    
    MyOrderViewController *vc=[MyOrderViewController new];
    vc.model=model;
    [self.navigationController pushViewController:vc animated:YES];
}

#pragma mark - 分享
- (void)fenxiang:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"分享");
}

#pragma mark - 收藏
- (void)shoucang:(UITapGestureRecognizer *)tapGes
{
   
    // 防止多次点击
    if (self.souCangIsClick == YES) {
         NSLog(@"收藏");
        // 点击过以后不能再次点击
        self.souCangIsClick = NO;
        NSString *iscollect = [NSString stringWithFormat:@"%@", [self.onLineProductMessageDic valueForKey:@"is_collected"]];
        // 构建url
        NSString *managerUrl = [NSString stringWithFormat:@"http://120.26.129.84/api/production/collect?token=%@", kCurrentUserToken];
        NSDictionary *paramaterDic = @{@"production_id": [self.onLineProductMessageDic valueForKey:@"id"]};
        if ([iscollect isEqualToString:@"0"]) {
            // 说明未收藏想要收藏
            AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
            [manager POST:managerUrl parameters:paramaterDic success:^(NSURLSessionDataTask *task, id responseObject) {
                NSDictionary *statusDic = [responseObject valueForKey:@"status"];
                NSString *msgString = [statusDic valueForKey:@"msg"];
                if ([msgString isEqualToString:@"收藏成功"]) {
                    self.shoucangImageV.image = [UIImage imageNamed:@"suocangguo-chanpin"];
                    [self.onLineProductMessageDic setValue:@"1" forKey:@"is_collected"];
                    NSLog(@"收藏成功");
                   
                }
                // 可以点击
                self.souCangIsClick = YES;
            } failure:^(NSURLSessionDataTask *task, NSError *error) {
                NSLog(@"请求失败");
            }];
        } else if ([iscollect isEqualToString:@"1"]) {
            // 说明已经收藏，想要取消收藏
            AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
            [manager DELETE:managerUrl parameters:paramaterDic success:^(NSURLSessionDataTask *task, id responseObject) {
                NSDictionary *statusDic = [responseObject valueForKey:@"status"];
                NSString *msgString = [statusDic valueForKey:@"msg"];
                if ([msgString isEqualToString:@"取消收藏成功"]) {
                    self.shoucangImageV.image = [UIImage imageNamed:@"weishoucang-chanpin"];
                    [self.onLineProductMessageDic setValue:@"0" forKey:@"is_collected"];
                    NSLog(@"取消收藏成功");
                    
                }
                // 可以点击
                self.souCangIsClick = YES;
            } failure:^(NSURLSessionDataTask *task, NSError *error) {
                NSLog(@"请求失败");
            }];
        }
    }
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
